<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PDF阅读器 - 天津大学《计算机网络》课程</title>
    <link rel="stylesheet" href="/public/textbook-styles.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
</head>
<body>
    <!-- 顶部工具栏 -->
    <header class="toolbar">
        <div class="toolbar-left">
            <button id="backBtn" class="tool-btn">← 返回</button>
            <h1 id="fileName">PDF阅读器</h1>
        </div>
        
        <div class="toolbar-center">
            <button id="prevPage" class="tool-btn">上一页</button>
            <span id="pageInfo">第 <span id="currentPage">1</span> 页，共 <span id="totalPages">1</span> 页</span>
            <button id="nextPage" class="tool-btn">下一页</button>
        </div>
        
        <div class="toolbar-right">
            <button id="zoomOut" class="tool-btn">缩小</button>
            <span id="zoomLevel">100%</span>
            <button id="zoomIn" class="tool-btn">放大</button>
            <button id="fullscreen" class="tool-btn">全屏</button>
        </div>
    </header>

    <!-- 主要内容区域 -->
    <main class="main-content">
        <!-- PDF显示区域 -->
        <section class="pdf-container" id="pdf-container">
            <div class="pdf-viewer" id="pdfViewer">
                <canvas id="pdfCanvas"></canvas>
            </div>
            
            <!-- 加载指示器 -->
            <div id="loadingIndicator" class="loading">
                <div class="spinner"></div>
                <p>正在加载PDF...</p>
            </div>
            
            <!-- 错误提示 -->
            <div id="errorMessage" class="error-message" style="display: none;">
                <p>无法加载PDF文件</p>
                <button onclick="location.reload()">重试</button>
            </div>
        </section>
    </main>

    <script src="/public/textbook.js?v=2.0"></script>
</body>
</html>
